﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Quotation
{
    public sealed class ETFType : StrictFlagBase<string, ETFType>
    {
        private ETFType(string value) : base(value) { }

        public static readonly ETFType Other = new ETFType("0");
        public static readonly ETFType SingleMarket = new ETFType("1");
        public static readonly ETFType CrossMarket = new ETFType("2");
        public static readonly ETFType CrossBorder = new ETFType("3");

        /// <summary>
        /// 隐式类型转换
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static implicit operator ETFType(string value)
        {
            if (value == null)
                return default(ETFType);
            else
            {
                ETFType rtn;
                ETFType.TryConvert(value, out rtn);
                return rtn;
            }
        }
    }
}
